<script>
    /*
        原型：每个对象上都有原型
        获取原型的方法
            1.Object.getPrototypeOf(obj)
            2.obj.__proto__
            3.obj.constructor.prototype


    */
    //    const obj = {name:"小明",age:20}
    //    console.log(Object.getPrototypeOf(obj));
    //    console.log(obj.__proto__);
    //    console.log(obj.constructor.prototype);


    /*
    原型链

     */
    o4Name = '构造函数创建的对象'
    function O4(name) {
        this.name = name;
        this.sayName = function () {
            console.log(this.name);
        }
    }

    const o4 = new O4(o4Name);
    console.log(o4);
    console.log(o4.__proto__);
    console.log(o4.__proto__.__proto__);
    console.log(o4.__proto__.__proto__.__proto__);

</script>